package com.ad.pet.ui;

import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;

import com.ad.pet.R;
import com.ad.pet.common.data.utils.glide.GlideUtil;
import com.ad.pet.utils.LyxUtils;

/**
 * Created by SEELE on 2019/6/3.
 */

public class InvatieFriendsHelpMeOpenDialog extends Dialog {
 

    private int screenWidth;
    private TextView mTvTips;

    public InvatieFriendsHelpMeOpenDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
        screenWidth = context.getResources().getDisplayMetrics().widthPixels;
        initView(context);
    }

    private void initView(Context context) {

        View view = View.inflate(context, R.layout.layout_invatie_friends_open,null);


        mTvTips = view.findViewById(R.id.tv_tips);
        ImageView imageView = view.findViewById(R.id.iv_clickme);
        GlideUtil.loadNoDefault(getContext(), LyxUtils.getImgUrl(R.drawable.ic_open_redbag),imageView);

        setContentView(view);



        Window window = this.getWindow();
        WindowManager.LayoutParams lp = window.getAttributes();
        lp.width = LyxUtils.dp2px(context,250); // 设置宽度
        lp.height = LyxUtils.dp2px(context,330);
        this.getWindow().setAttributes(lp);
        window.setGravity(Gravity.CENTER);
    }

    public  TextView getTipsView(){

        return mTvTips;
    }
}
